import axios from '@/libs/api.request'

/**
 * 列表
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const getList = (params) => {
  return axios.request({
    url: 'Task/index',
    method: 'get',
    params: params
  })
}

/**
 * 添加
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const addTask = (data) => {
  return axios.request({
    url: 'Task/add',
    method: 'post',
    data
  })
}

/**
 * 删除
 * @param status
 * @param id
 * @returns {wx.RequestTask | never}
 */
export const delTask = (id, game_hash) => {
  return axios.request({
    url: 'Task/del',
    method: 'get',
    params: {
      id: id,
      game_hash: game_hash
    }
  })
}

/**
 * 获取订阅消息
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const getMessage = (params) => {
  return axios.request({
    url: 'Task/getMessage',
    method: 'get',
    params: params
  })
}
